<template>
  <div id="app" :class="{ fullscreen: isFullscreen }">
    <nav v-if="!isFullscreen" class="navigation">
      <h1>Simple Mind Map 示例集合</h1>
      <div class="nav-buttons">
        <router-link to="/advanced-mindmap" class="nav-btn">高级功能示例</router-link>
        <router-link to="/context-menu-mindmap" class="nav-btn">右键菜单示例</router-link>
      </div>
      <div class="description">
        <p>本项目展示了在 Vue 2 中使用 simple-mind-map 的多种方式</p>
      </div>
    </nav>
    <router-view />
  </div>
</template>

<script>
export default {
  name: 'App',
  computed: {
    isFullscreen() {
      return ['FullScreenMindMap', 'Vue2MindMapExample', 'AdvancedMindMap', 'MindMapWithContextMenu'].includes(this.$route.name);
    }
  }
}
</script>

<style>
#app {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}

.navigation {
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
}

.navigation h1 {
  margin: 0 0 20px 0;
  font-size: 2rem;
  font-weight: 300;
}

.nav-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-block;
  padding: 12px 24px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.nav-btn.router-link-active {
  background-color: rgba(255, 255, 255, 0.9);
  color: #764ba2;
  border-color: rgba(255, 255, 255, 0.9);
}

.description {
  margin-top: 15px;
}

.description p {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.9;
}

.fullscreen {
  height: 100vh;
  overflow: hidden;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .nav-btn {
    width: 200px;
  }
  
  .navigation h1 {
    font-size: 1.5rem;
  }
}
</style>
